from django.db import models

# 用户表
class User(models.Model):
    username=models.CharField(max_length=32)
    password=models.CharField(max_length=225)
    status=models.BooleanField(default=True)
    auth=models.IntegerField(default=0)
    addtime=models.DateTimeField(auto_now_add=True)

    class Meta:
        db_table='user'


# 专业表
class Professoinal(models.Model):
    name=models.CharField(max_length=32)
    status=models.BooleanField(default=True)
    addtime=models.DateTimeField(auto_now_add=True)

    class Meta:
        db_table='professoinal'


# 课程表
class Cours(models.Model):
    name=models.CharField(max_length=32)
    status=models.BooleanField(default=True)
    addtime=models.DateTimeField(auto_now_add=True)
    professoinal=models.ForeignKey('Professoinal',on_delete=models.CASCADE)

    class Meta:
        db_table='course'


# 日志表
class Log(models.Model):
    username=models.CharField(max_length=32)
    addtime=models.DateTimeField(auto_now_add=True)

    class Meta:
        db_table='log'